package com.witframework.dynoengine.render.form;

import com.witframework.dynoengine.render.formater.DefaultCellFormat;
import com.witframework.util.StringTools;


public class TextareaRender extends FormFieldRender{
	
	public String render() {			
		html.textarea().name((String)getParameter(super.PARAM_name));
		String tooltipText=(String)getParameter(super.PARAM_tiptext);
		if(!StringTools.parseBoolean((String)getParameter(super.PARAM_editable))) html.readonly();
		html.append("tooltipText=\""+(tooltipText==null?"":tooltipText)+"\"");
		String validation=(String)getParameter(super.PARAM_validation);
		html.append(" class=\""+(validation==null?"":validation)+"\"");
		html.close();
		String value=new DefaultCellFormat().parse(getParameter(super.PARAM_value));
		if(value!=null)	html.append(value);
		html.textareaEnd();
		return html.toString();
	}

}
